﻿using System;

namespace Communication.Message.Buffer
{
	// Token: 0x0200000C RID: 12
	internal class LittleEndianHeapMessageBuffer : HeapMessageBuffer
	{
		// Token: 0x0600008E RID: 142 RVA: 0x00002705 File Offset: 0x00000905
		public LittleEndianHeapMessageBuffer(int length) : base(length)
		{
		}

		// Token: 0x0600008F RID: 143 RVA: 0x0000270E File Offset: 0x0000090E
		public LittleEndianHeapMessageBuffer(byte[] array) : base(array)
		{
		}

		// Token: 0x06000090 RID: 144 RVA: 0x00002717 File Offset: 0x00000917
		private LittleEndianHeapMessageBuffer(byte[] array, int readerIndex, int writerIndex) : base(array, readerIndex, writerIndex)
		{
		}

		// Token: 0x06000091 RID: 145 RVA: 0x00002722 File Offset: 0x00000922
		public override ByteOrder Order()
		{
			return ByteOrder.LITTLE_ENDIAN;
		}

		// Token: 0x06000092 RID: 146 RVA: 0x00002725 File Offset: 0x00000925
		public override short GetShort(int index)
		{
			return (short)((int)this.array[index + 1] << 8 | (int)(this.array[index] & byte.MaxValue));
		}

		// Token: 0x06000093 RID: 147 RVA: 0x00002744 File Offset: 0x00000944
		public override int GetInt(int index)
		{
			return (int)(this.array[index] & byte.MaxValue) | (int)(this.array[index + 1] & byte.MaxValue) << 8 | (int)(this.array[index + 2] & byte.MaxValue) << 16 | (int)(this.array[index + 3] & byte.MaxValue) << 24;
		}

		// Token: 0x06000094 RID: 148 RVA: 0x0000279A File Offset: 0x0000099A
		public override void SetShort(int index, short s)
		{
			this.array[index + 1] = (byte)(s >> 8);
			this.array[index] = (byte)(s & 255);
		}

		// Token: 0x06000095 RID: 149 RVA: 0x000027BA File Offset: 0x000009BA
		public override void SetInt(int index, int i)
		{
			this.array[index] = (byte)i;
			this.array[index + 1] = (byte)(i >> 8);
			this.array[index + 2] = (byte)(i >> 16);
			this.array[index + 3] = (byte)(i >> 24);
		}

		// Token: 0x06000096 RID: 150 RVA: 0x000027F2 File Offset: 0x000009F2
		public override MessageBufferFactory Factory()
		{
			return HeapMessageBufferFactory.GetInstance(ByteOrder.LITTLE_ENDIAN);
		}
	}
}
